package com.agent.commons.enums;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;

/**
 * 题目类型
 */
@AllArgsConstructor
@Getter
public enum QuestionType {
    FILL("fill"),
    CHOICE("choice"),
    ESSAY("essay");
    private String name;

    /**
     * 获取指定枚举类型
     * @param name
     * @return
     */
    public static QuestionType get(String name){
        for(QuestionType value : values()){
            if(value.name.equals(name)){
                return value;
            }
        }
        return null;
    }
}
